package net.maku.qdd.common.query;

import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 查询基础类
 */
@Data
@Schema(description = "查询条件")
public class Query {

    @Schema(description = "当前页码，从1开始", example = "1")
    private Integer page = 1;

    @Schema(description = "每页显示记录数", example = "10")
    private Integer limit = 10;

    @Schema(description = "排序字段")
    private String order;

    @Schema(description = "排序方式，asc或desc")
    private String asc;

    /**
     * 获取当前页码（从0开始，用于MyBatis-Plus）
     */
    public Integer getCurrent() {
        return page;
    }

    /**
     * 获取每页显示记录数
     */
    public Integer getSize() {
        return limit;
    }
}
